using System.Collections;

namespace Is
{
    public sealed class ContainsCollection : IsBase<ContainsCollection, ICollection>
    {
        internal ContainsCollection(ICollection target, bool negate) : base(target, negate) { }

        public bool Exactly(int expectedCount)
        {
            return ((IIs<ICollection>)this).Apply(
                t => Core.Is.ContainsExactly(t, expectedCount),
                t => !Core.Is.ContainsExactly(t, expectedCount));
        }

        public bool AtLeast(int expectedMinimumCount)
        {
            return ((IIs<ICollection>)this).Apply(
                t => Core.Is.ContainsAtLeast(t, expectedMinimumCount),
                t => !Core.Is.ContainsAtLeast(t, expectedMinimumCount));
        }

        public bool NoMoreThan(int expectedMaximumCount)
        {
            return ((IIs<ICollection>)this).Apply(
                t => Core.Is.ContainsNoMoreThan(t, expectedMaximumCount),
                t => !Core.Is.ContainsNoMoreThan(t, expectedMaximumCount));
        }

        public bool Zero()
        {
            return Exactly(0);
        }

        public bool One()
        {
            return Exactly(1);
        }
    }
}